<template>
  <!-- 生成采购合同 -->
  <div class="purchase-export">
    <div class="btns" style="margin:10px;margin-bottom:1em;background:#fff">
      <el-select v-model="searchForm.proIds" style="margin-right: 6px" collapse-tags multiple filterable clearable placeholder="请选择项目" value-key="name">
        <el-option v-for="item in projects" :key="item.id" :label="item.projectName" :value="item.id" />
      </el-select>
      <el-select v-model="searchForm.status" style="margin-right: 6px" filterable clearable placeholder="合同状态" value-key="name">
        <el-option key="1" label="有合同" value="1" />
        <el-option key="0" label="无合同" value="0" />
      </el-select>
      <el-input v-model="searchForm.supplier" type="text" size="small" placeholder="供应商" clearable/>
      <el-input v-model="searchForm.name" type="text" size="small" placeholder="设备名" clearable/>
      <el-button style="margin-right: 6px" type="primary" icon="el-icon-search" size="small" @click="clickToSearch">查询</el-button>
    </div>
    <div style="margin:10px;margin-bottom:1em;background:#fff">
      <div style="padding:10px">
        <el-button :disabled="selectedRowKeys.length>0?false:true" type="primary" icon="el-icon-document" size="small" :loading="downloadLoading" @click="handleDownload">导出Excel</el-button>
        <el-button :disabled="selectedRowKeys.length>0?false:true"  type="primary" icon="el-icon-document" size="small" @click="addContract">生成采购合同</el-button>
      </div>
      <div style="padding:10px">
        <a-table
          size="small"
          ref="purchases"
          :rowKey="record => record.id"
          :row-class-name="tableRowClassName"
          :loading="loading"
          :pagination="table.pagination"
          :data-source="purchases"
          :scroll="purchases.length > 0?{ x: 1500, y: tableHeight}:{}"
          :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, onSelect: onSelect }">
          <a-table-column :width="80" align="center" title="状态" key="contractId" data-index="contractId">
            <template slot-scope="text">
              <el-tag :type="text? 'success':'info'">{{ text?'有合同':'无合同' }}</el-tag>
            </template>
          </a-table-column>
          <a-table-column defaultSortOrder="ascend" :sorter="(a, b) => a.sort-b.sort" title="序号" key="sort" data-index="sort" align="center" :width="50" />
          <a-table-column :width="100" align="center" ellipsis="true" key="purchaseProName" title="项目" data-index="purchaseProName"></a-table-column>
          <a-table-column :width="100" ellipsis="true" key="item" title="设备" data-index="item" align="center"/>
          <a-table-column
            :width="100"
            ellipsis="true"
            :sorter="(a, b) => a.purchaseSupply.supplier.localeCompare(b.purchaseSupply.supplier)"
            key="purchaseSupply.supplier"
            title="供应商"
            data-index="purchaseSupply.supplier"
            align="center"
            @filter="onFilter"
            @filterDropdownVisibleChange="onFilterDropdownVisibleChange"
            :scopedSlots="scopedSlots">
            <template slot="filterDropdown" slot-scope="{ setSelectedKeys, selectedKeys, confirm, clearFilters, column }"
                      style="padding: 8px">
              <a-input
                v-ant-ref="c => (searchInput = c)"
                :placeholder="`查找供应商`"
                :value="selectedKeys[0]"
                style="width: 188px; margin-bottom: 8px; display: block;"
                @change="e => setSelectedKeys(e.target.value ? [e.target.value] : [])"
                @pressEnter="() => handleSearch(selectedKeys, confirm, column.dataIndex)"
              />
              <el-button
                type="primary"
                icon="el-icon-search"
                size="small"
                style="width: 90px; margin-right: 8px"
                @click="() => handleSearch(selectedKeys, confirm, column.dataIndex)"
              >
                查找
              </el-button>
              <el-button size="small" style="width: 90px" @click="() => handleReset(clearFilters)">
                重置
              </el-button>
            </template>
          </a-table-column>
          <a-table-column :width="100" ellipsis="true" key="purchaseSupply.brand" title="品牌" data-index="purchaseSupply.brand" align="center"/>
          <a-table-column v-show="item.commons == false" v-for="item in currentTemplate.tableColumn" :width="item.width" ellipsis="true" :key="item.key" :title="item.title" :data-index="item.dataIndex" align="center"/>
          <a-table-column :width="70" key="purchaseSupply.price" title="单价" data-index="purchaseSupply.price" align="center"/>
          <a-table-column :width="80" key="purchaseSupply.totalPrice" title="总价" align="center">
            <template slot-scope="text,record">
              {{Number(parseFloat(record.purchaseSupply.price)*parseFloat(record.number)).toFixed(2)}}
            </template>
          </a-table-column>
          <a-table-column :width="50" key="unit" title="单位" data-index="unit" align="center"/>
          <a-table-column :width="70" key="number" title="数量" data-index="number" align="center"/>
          <a-table-column :width="100" ellipsis="true" key="purchaseSupply.model" title="报价型号" data-index="purchaseSupply.model" align="center"/>
          <a-table-column :width="100" ellipsis="true" key="purchaseSupply.params" title="报价参数" data-index="purchaseSupply.params" align="center"/>
          <a-table-column :width="100" ellipsis="true" key="purchaseSupply.warranty" title="质保期" data-index="purchaseSupply.warranty" align="center"/>
          <a-table-column :width="100" ellipsis="true" key="purchaseSupply.delivery" title="货期" data-index="purchaseSupply.delivery" align="center"/>
          <a-table-column :width="100" ellipsis="true" key="purchaseSupply.remark" title="备注" data-index="purchaseSupply.remark" align="center"/>
          <a-table-column :width="100" ellipsis="true" key="purchaseSupply.revisedPrice" title="被修正价" data-index="purchaseSupply.revisedPrice" align="center"/>
          <a-table-column :width="100" ellipsis="true" key="purchaseSupply.revisedRemark" title="修正原因" data-index="purchaseSupply.revisedRemark" align="center"/>
          <a-table-column :width="120" fixed="right" key="action" title="操作" align="center">
            <template slot-scope="text, record">
              <!-- <el-button @click="editRevisePrice(record.purchaseSupply.id)" type="success" icon="el-icon-edit" size="mini" style="padding: 7px 10px;">供货价</el-button> -->
              <el-button @click="editSupplyMessage(record)" type="success" icon="el-icon-edit" size="mini" style="padding: 7px 10px;">修改</el-button>
            </template>
          </a-table-column>
        </a-table>
      </div>
    </div>
    <!-- 模态框 -->
    <el-dialog v-el-drag-dialog title="生成采购合同" :visible.sync="visible">
      <el-form ref="form" :model="form" :rules="rules" status-icon>
        <el-form-item label="合同名" label-width="80px" size="small" prop="contractName">
          <el-input type="text" v-model="form.contractName"></el-input>
        </el-form-item>
        <el-form-item label="类型" label-width="80px" size="small" prop="type">
          <el-radio-group v-model="form.type">
            <el-radio :label="0">我方合同</el-radio>
            <el-radio :label="1">对方合同</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="合同编号" label-width="80px" size="small" prop="contractNo">
          <el-input type="text" v-model="form.contractNo" :suffix-icon="form.contractNoLoading==true?'el-icon-loading':''"></el-input>
        </el-form-item>
        <el-form-item label="备注" label-width="80px" size="small" prop="remark">
          <el-input type="textarea" v-model="form.remark"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button size="small" @click="visible = false">取 消</el-button>
        <el-button type="primary" size="small" @click="submitHandler('form')">提 交</el-button>
      </div>
    </el-dialog>

    <!-- 修改供货价 -->
    <el-dialog v-el-drag-dialog title="修改供货价" :visible.sync="revisePriceVisible">
      <el-form :model="revisePriceForm" status-icon>
        <el-form-item label="修正供货价" label-width="80px" size="small" prop="revisePrice">
          <el-input type="text" v-model="revisePriceForm.revisedPrice"></el-input>
        </el-form-item>
        <el-form-item label="修正原因" label-width="80px" size="small" prop="revisedRemark">
          <el-input type="textarea" v-model="revisePriceForm.revisedRemark"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button size="small" @click="revisePriceVisible = false">取 消</el-button>
        <el-button type="primary" size="small" @click="submitRevisePrice()">提 交</el-button>
      </div>
    </el-dialog>

    <!-- 修改供货信息 -->
    <el-dialog v-el-drag-dialog title="修改供货信息" :visible.sync="supply.visible">
      <el-form :model="supply.form" status-icon>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="序号" label-width="80px" prop="sort">
              <el-input v-model="supply.sort" type="input" :disabled="true"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="设备名" label-width="80px" prop="name">
              <el-input v-model="supply.name" type="input" :disabled="true"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="报价商" label-width="80px" prop="supplier">
              <el-select style="margin-left: 8px" v-model="supply.form.supplierId" filterable clearable placeholder="请选择供应商" value-key="name" size="small">
                <el-option v-for="item in supply.suppliers" :key="item.id" :label="item.supplier" :value="item.id" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="报价品牌" label-width="80px" prop="brand">
              <el-input v-model="supply.form.brand" type="input"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="16">
            <el-form-item label="型号" label-width="80px" prop="model">
              <el-input v-model="supply.form.model" type="input"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="供货价" label-width="80px" prop="price">
              <el-input v-model="supply.form.price" type="input"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="修正前供货价" label-width="80px" prop="revisedPrice">
              <el-input v-model="supply.form.revisedPrice" type="input" disabled></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="货期" label-width="80px" prop="delivery">
              <el-input v-model="supply.form.delivery" type="input"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="质保期" label-width="80px" prop="warranty">
              <el-input v-model="supply.form.warranty" type="input"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="24">
            <el-form-item label="修正原因" label-width="80px" prop="revisedRemark">
              <el-input v-model="supply.form.revisedRemark" type="input"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="24">
            <el-form-item label="报价备注" label-width="80px" prop="remark">
              <el-input v-model="supply.form.remark" type="input"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="24">
            <el-form-item label="参数" label-width="80px" prop="params">
              <el-input v-model="supply.form.params" type="textarea"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="danger" style="float:left" size="small" @click="insertSupplyMessage()">新增</el-button>
        <el-button type="warning" size="small" @click="updateSupplyMessage()">修改</el-button>
        <el-button size="small" @click="supply.visiable = false">取 消</el-button>
      </div>
    </el-dialog>

  </div>
</template>
<script>
  import request from '@/utils/request'
  import { getAction, postActionByJson, postActionByQueryString } from '@/api/manage'
  import '@/styles/auto-style.css'
  import { getUser } from '@/utils/auth'
  import { onFilterDropdownVisibleChange, onFilter, handleSearch, handleReset } from '@/utils/column-search'
  import elDragDialog from '@/directive/el-drag-dialog'
  import list from '@/pages/backlog/list.vue'

  export default {
  components: { list },
    directives: { elDragDialog },
    //name: '生成采购合同',
    data() {
      const scopedSlots = {
        filterDropdown: 'filterDropdown',
        filterIcon: 'filterIcon',
        customRender: 'customRender',
      }
      var validNo = (rule, value, callback) => {
        if (!value) {
          return callback(new Error('不能为空'));
        }
        request.get('/purchase/purchaseContractGenerate/findContractNo',{
          params: { contractNo: value }
        })
          .then(response => {
            if (response.data > 0) {
              callback(new Error('合同编号已存在'))
            }else {
              callback()
            }
          })
      };
      return {

        supply: {
          suppliers: [],
          visible: false,
          form: {}
        },
        b: [],
        //跨页记录选择项
        selectedRowsPlus: [],
        table: {
          pagination: {
            showTotal: total => `共 ${total} 条结果`,
            showQuickJumper: true,
            showSizeChanger: true,
            pageSizeOptions: ['15', '30', '45'],
            current: 1,
            pageSize: 15,
            total: 0,
            onChange: (item) => {
              this.table.pagination.current = item
              this.toSearch()
            },
            onShowSizeChange: (current, pageSize) => {
              this.table.pagination.pageSize = pageSize
              this.toSearch()
            }, // 改变每页数量时更新显示
          }
        },
        revisePriceVisible: false,
        revisePriceForm: {},
        currentTemplate: {},

        searchForm: {},
        purchases: [],
        loading: true,
        downloadLoading: false,
        selectedRowKeys: [],
        projects: [],
        tableHeight: document.documentElement.clientHeight-83-196,
        visible: false,
        form: { type: 0, contractNoLoading: false },
        role: {},

        selectSupplier: null,

        scopedSlots,
        searchText: '',
        searchedColumn: '',
        searchInput: null,
        url:{
          findSupplierByParams: '/supply/supplier/findSupplierByParams',
          saveOrUpdateSupplyMessage: '/purchase/contract/saveOrUpdateSupplyMessage'
        },
        rules: {
          contractNo: [
            { validator: validNo, trigger: 'blur'}
          ],
          contractName: [
            { required: true, message: '不能为空', trigger: 'blur'}
          ]
        }
      }
    },
    mounted() {
      var that = this
      that.tableHeight = document.documentElement.clientHeight-83-196
    },
    created() {
      this.init()
      this.role = this.$store.getters.roles[0]
    },
    methods: {
      loadSuppliers() {
        getAction(this.url.findSupplierByParams, {})
        .then(resp => {
          this.supply.suppliers = resp.data
        })
      },
      updateSupplyMessage(){
        postActionByJson(this.url.saveOrUpdateSupplyMessage, {mark: 0, purchaseSupply: this.supply.form})
        .then(resp =>{
          this.$message.success(resp.data + "条修改成功")
        }).catch((e)=>{
          this.$message.error(e)
        }).finally(()=>{
          this.supply.visible = false
          this.toSearch()
        })
      },
      insertSupplyMessage(){
        postActionByJson(this.url.saveOrUpdateSupplyMessage, {mark: 1, purchaseSupply: this.supply.form})
        .then(resp =>{
          this.$message.success(resp.data + "条新增成功")
        }).catch((e)=>{
          this.$message.error(e)
        }).finally(()=>{
          this.supply.visible = false
          this.toSearch()
        })
      },
      async editSupplyMessage(record){
        await this.loadSuppliers()
        this.supply.sort = record.sort
        this.supply.name = record.item
        this.supply.form = record.purchaseSupply
        this.supply.visible = true
      },
      tableRowClassName(row, index) {
        if (this.selectedRowKeys.includes(row.id)) {
          return 'selected';
        }
      },
      loadCurrentTemplate(id) {
        if (id) {
          getAction('/inquiry/template/findInquiryTemplate', {id: id})
            .then(resp => {
              resp.data[0].jsonKeys = JSON.parse(resp.data[0].jsonKeys)
              resp.data[0].tableColumn = JSON.parse(resp.data[0].tableColumn)
              this.currentTemplate = resp.data[0]
            })
            .catch(()=> {
              this.loading = false
            })
        }

      },
      /**
       * 弹出生成合同模态框
       */
      addContract() {

        this.form.type = 0
        this.form.contractNoLoading = true
        getAction('/purchase/contract/automaticGenerationContractNo', {})
          .then(resp => {
            this.$set(this.form, 'contractNo', resp.data)
            this.form.contractNoLoading = false
          })
          .catch(() => {
            this.form.contractNoLoading = false
          })

        this.visible = true
      },

      /**
      * 弹出修正报价模态框
      **/
      editRevisePrice(id){
        this.revisePriceForm = {}
        this.revisePriceForm.id = id
        this.revisePriceVisible = true
      },

      /**
       * 修改供货价
       */
      submitRevisePrice() {
        if (this.revisePriceForm.revisedPrice){
          this.revisePriceForm.revisePeople = getUser()
          postActionByQueryString('/purchase/contract/updateSupplyPrice', this.revisePriceForm)
          .then(resp => {
            this.$message({ message: resp.message, type: 'success' })
          }).catch(()=>{
            this.$message.error('提交失败')
          }).finally(()=>{
            this.revisePriceVisible = false
            this.toSearch()
          })
        }else {
          this.$message({type: 'warning', message: '请填写'})
        }

        /*this.$prompt('请输入供货价', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          inputPattern: /^[1-9][0-9]*([\.][0-9]{1,2})?$/,
          inputErrorMessage: '格式不正确'
        }).then(({ value }) => {
          row.price = value
          row.updateOperator = getUser()
          postActionByJson('/purchase/contract/updateSupplyPrice', row)
            .then(resp => {
              this.$message({ message: resp.message, type: 'success' })
              this.toSearch()
            })
        }).catch(() => {
        });*/
      },
      /**
       * 生成采购合同提交 事件
       */
      submitHandler(form) {
        this.$refs[form].validate((valid) => {
          if (valid) {
            let form = this.form
            form.operator = getUser()
            postActionByJson('/purchase/purchaseContractGenerate/contractGenerate', { purchaseContract: form, itemIds: this.selectedRowKeys })
            .then( resp => {
              this.$message({ message: resp.message, type: 'success' })
            }).catch(()=>{
              this.$message({ message: "生成失败", type: 'error' })
            }).finally(()=>{
              this.visible = false
              this.toSearch()
            })
          }else {
            console.log('error commit')
            return false
          }
        })
      },
      async a(){
        await postActionByQueryString('/purchase/generatePurchaseContract/findItemsAndSupplyByProjectIdAll', this.searchForm)
        .then(resp => {
          this.b = resp.data
        }).catch(()=> {
          this.$message.error('导出失败')
        }).finally(()=>{
          
        })
      },

      /**
       * 导出excel
       */
      async handleDownload() {
        if (this.selectedRowKeys.length) {
          this.downloadLoading = true
          await this.a()
          console.info(this.b)
          if(this.b){
            console.info(1111111)
            import('@/vendor/Export2Excel').then(excel => {

            const tHeader = ['序号', '设备名称', '供应商', '型号', '配置要求', '商家参数', '单位', '数量', '单价', '总价', '品牌', '货期', '质保期', '备注']
            const filterVal = ['sort', 'name', 'supplier', 'suModel', 'params', 'suParams', 'unit', 'number', 'price',
              'totalPrice', 'brand', 'delivery', 'warranty', 'remark']
            let suppliers = []
            let list = []
            let sort = 0

            

            this.b.map(item=>{
              sort ++
              if(this.selectedRowKeys.includes(item.id)){
                list.push({
                  sort: sort,
                  name: item.item,
                  supplier: item.purchaseSupply.supplier,
                  suModel: item.purchaseSupply.model,
                  params: item.params,
                  suParams: item.purchaseSupply.params,
                  unit: item.unit,
                  number: item.number,
                  price: item.purchaseSupply.price,
                  totalPrice: item.purchaseSupply.price * item.number,
                  brand: item.purchaseSupply.brand,
                  delivery: item.purchaseSupply.delivery,
                  warranty: item.purchaseSupply.warranty,
                  remark: item.purchaseSupply.remark,
                })
                if (!suppliers.includes(item.purchaseSupply.supplier)) {
                  suppliers.push(item.purchaseSupply.supplier)
                }
              }
            })
            this.filename = ''
            suppliers.map(supplier => {
              //alert(supplier)
              this.filename += '【'+supplier+'】'
            })
            const data = this.formatJson(filterVal, list)
            excel.export_json_to_excel({
              header: tHeader,
              data,
              filename: this.filename
            })
            this.downloadLoading = false
            this.selectedRowKeys = []

          })
          }    
        } else {
          this.$message({
            message: 'Please select at least one item',
            type: 'warning'
          })
        }
      },
      /**
       * 格式化json 导出excel时 调用
       */
      formatJson(filterVal, jsonData) {
        return jsonData.map(v => filterVal.map(j => v[j]))
      },
      /**
       * table多选触发事件
       */
      onSelectChange(keys, rows) {

        // let selectedId = []
        // keys.map(id => {
        //   selectedId.push(id)
        // })
        // this.selectedRowKeys = selectedId
        // console.info(this.selectedId)

        // rows.map(x=>{
        //   if(this.selectSupplier == null){
        //     console.info(2222)

        //     this.selectSupplier = x.purchaseSupply.supplier
        //   }else if(this.selectSupplier === x.purchaseSupply.supplier){
        //     console.info(1111)
        //   }
        // })

        // if(selectedRows.length == 0) {
        //   this.selectSupplier = null
        // }
        // let rows = []
        // selectedRows.map(item => {
        //   if (!item.contractId) {
        //       if(this.selectSupplier == null) {
        //         this.selectSupplier = item.purchaseSupply.supplier
        //       }
        //       if ((item.id && (item.purchaseSupply.supplier == this.selectSupplier || !this.selectSupplier))) {
        //         rows.push(item.id)
        //       }else {
        //         this.$message({type: 'info', message: '只能选同一个供应商'})
        //       }
        //   }else {
        //       this.$message({type: 'info', message: '该采购项已生成过合同'})
        //   }
        // })
        //this.selectedRowKeys = rows
      },
      //跨页保留勾选
      onSelect(record, selected, selectedRows, nativeEvent){

        let selectedRowsKeys = this.selectedRowKeys
          if (!record.contractId) {
            if(this.selectSupplier == null) {
              this.selectSupplier = record.purchaseSupply.supplier
            }
            if (record.id && record.purchaseSupply.supplier == this.selectSupplier) {
              if(selected){
                this.selectedRowKeys.push(record.id)
              }
            }else{
              this.$message({type: 'info', message: '只能选同一个供应商'})
            }

          }else{
            this.$message({type: 'info', message: '该采购项已生成过合同'})
          }
        if(!selected){
          selectedRowsKeys.map((x, item) => {
            if(x === record.id){
              selectedRowsKeys.splice(item, 1)
            }
          })
        }
        if(this.selectedRowKeys.length === 0){
          this.selectSupplier = null
        }
      },
      clickToSearch(){
        //点击查询时清空选择项
        this.selectedRowKeys = []
        this.toSearch()
      },
      toSearch() {
        this.loading = true
        this.searchForm.pageNum = this.table.pagination.current,
        this.searchForm.pageSize = this.table.pagination.pageSize
        postActionByQueryString('/purchase/generatePurchaseContract/findItemsAndSupplyByProjectId', this.searchForm)
        .then(async resp => {
          if (resp.data.length > 0) {
            await this.loadCurrentTemplate(resp.data[0].templateId)
          }
          this.purchases = resp.data.records
          this.table.pagination.current = parseInt(resp.data.current)
          this.table.pagination.pageSize = parseInt(resp.data.size)
          this.table.pagination.total = parseInt(resp.data.total)
        }).catch(()=> {
          this.$message.error('查询失败')
        }).finally(()=>{
          this.loading = false
        })
      },
      /**
       * 页面初始化 调用
       */
      async init() {
        await this.loadProjects()
        if(this.projects.length > 0){
          this.toSearch()
        }else {
          this.loading = false
        }
      },
      /**
       * 查询所有采购项目
       */
      async loadProjects() {
        await request.get('/purchase/project/findAllLike')
          .then(response => {
            this.projects = response.data
          })
      },
      /**
       * ant table 列筛选相关方法
       */
      onFilterDropdownVisibleChange,
      onFilter,
      handleReset,
      handleSearch,
    }
  }
</script>

<style lang="scss" scoped>
  .purchase-export {
    /deep/.el-form-item__content{
      height:auto;
      line-height:32px;
      margin-left:90px!important
    }
    /deep/.ant-table tbody > tr.ant-table-row-selected > td{
      background: #aad6ff;
    }
  }
</style>
